
package nccloud.impl.hrjx.bill;

import java.io.File;
import java.io.InputStream;
import java.util.Map;

import nc.ui.querytemplate.querytree.IQueryScheme;
import nc.vo.hrjx.jxxsdata.AggJxXsDataVO;
import nc.vo.hrjx.jxxsdata.JxXsDataVO;
import nc.vo.pub.BusinessException;
import nc.vo.pub.lang.UFDate;
import nccloud.bs.hrjx.bill.aggbusi.ace.bp.CreateDataBp;
import nccloud.bs.hrjx.bill.aggbusi.ace.bp.DeleteBp;
import nccloud.bs.hrjx.bill.aggbusi.ace.bp.ExcelBp;
import nccloud.bs.hrjx.bill.aggbusi.ace.bp.WorkFlowBp;
import nccloud.impl.pub.ace.AceAggbusiJxXsDataVOPubServiceImpl;
import nccloud.itf.hrjx.bill.IJxxsdatavoMaintain ;

public class JxxsdatavoMaintainImpl extends AceAggbusiJxXsDataVOPubServiceImpl implements IJxxsdatavoMaintain  {

        @Override
        public void delete(AggJxXsDataVO[] clientFullVOs,
                        AggJxXsDataVO[] originBills) throws BusinessException {
                super.pubdeleteBills(clientFullVOs, originBills);
        }

        @Override
        public AggJxXsDataVO[] insert(AggJxXsDataVO[] clientFullVOs,
                        AggJxXsDataVO[] originBills) throws BusinessException {
                return super.pubinsertBills(clientFullVOs, originBills);
        }

        @Override
        public AggJxXsDataVO[] update(AggJxXsDataVO[] clientFullVOs,
                        AggJxXsDataVO[] originBills) throws BusinessException {
                return super.pubupdateBills(clientFullVOs, originBills);
        }

        @Override
        public AggJxXsDataVO[] query(IQueryScheme queryScheme)
                        throws BusinessException {
                return super.pubquerybills(queryScheme);
        }

        @Override
        public AggJxXsDataVO[] save(AggJxXsDataVO[] clientFullVOs,
                        AggJxXsDataVO[] originBills) throws BusinessException {
                return super.pubsendapprovebills(clientFullVOs, originBills);
        }

        @Override
        public AggJxXsDataVO[] unsave(AggJxXsDataVO[] clientFullVOs,
                        AggJxXsDataVO[] originBills) throws BusinessException {
                return super.pubunsendapprovebills(clientFullVOs, originBills);
        }

        @Override
        public AggJxXsDataVO[] approve(AggJxXsDataVO[] clientFullVOs,
                        AggJxXsDataVO[] originBills) throws BusinessException {
                return super.pubapprovebills(clientFullVOs, originBills);
        }

        @Override
        public AggJxXsDataVO[] unapprove(AggJxXsDataVO[] clientFullVOs,
                        AggJxXsDataVO[] originBills) throws BusinessException {
                return super.pubunapprovebills(clientFullVOs, originBills);
        }

		@Override
		public JxXsDataVO[] createData(String[] ids) throws BusinessException {
			return new CreateDataBp().exec(ids);
		}
		@Override
		public JxXsDataVO[] createData(UFDate bizDate, String[] ids) throws BusinessException {
			return new CreateDataBp().exec(bizDate, ids);
		}

		@Override
		public File getExcelFile(Map<String, String[]> webMap) throws BusinessException {
			return new ExcelBp().getExcelFile(webMap);
		}

		@Override
		public Map<String, Object> importExcel(InputStream fileInput, String fileName) throws Exception {
			return new ExcelBp().importExcel(fileInput, fileName);
		}

		@Override
		public void workflow(String[] pks, String action, String message) throws Exception {
			WorkFlowBp bp = new WorkFlowBp();
			switch (action) {
			case "COMMIT":
				bp.commit(pks);
				break;

			case "UNCOMMIT":
				bp.uncommit(pks);
				break;
				
			case "APPROVE":
				bp.approve(pks);
				break;
				
			case "UNAPPROVE":
				bp.unapprove(pks);
				break;
				
			case "BACKAPPROVE":
				bp.backapprove(pks, message);
				break;
			default:
				break;
			}
		}

		@Override
		public void delete(AggJxXsDataVO... aggVOs) throws Exception {
			new DeleteBp().exec(aggVOs);
		}
}
